﻿Public Class TakeoutDeliver_Page
    Public Sub Initialize()
        TextBoxOrderId.Text = ""
        TextBoxName.Text = ""
    End Sub

    Private Sub ButtonOK_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonOK.Click
        Try
            If TextBoxOrderId.Text <> "" Then GlobalClass.OrderCode = TextBoxOrderId.Text
            TakeoutServe.deliver(GlobalClass.OrderCode, TextBoxName.Text)
            MsgBox("送货完成!")
        Catch err As Exception
            MsgBox(err.Message)
        End Try
    End Sub

    Private Sub ButtonReset_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonReset.Click
        Initialize()
    End Sub

    Private Sub TakeoutDeliver_Page_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles Me.KeyDown
        If e.Key = Key.Return Then ButtonOK_Click(sender, New RoutedEventArgs)
    End Sub
End Class
